package xyz.masaikk.mj;

import java.util.ArrayList;
import java.util.Objects;

public class GSK<E> {
    private ArrayList<E> list = new ArrayList<>();
    public int getSize(){
        return this.list.size();
    }
    public void addEle(E e){
        this.list.add(e);
    }
    public E popEle(){
        E o=list.get(getSize()-1);
        list.remove(getSize()-1);
        return o;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GSK<?> gsk = (GSK<?>) o;
        return Objects.equals(list, gsk.list);
    }

    @Override
    public int hashCode() {
        return Objects.hash(list);
    }

    @Override
    public String toString() {
        return "GSK{" +
                "list=" + list +
                '}';
    }
}
